package com.ian.service.impl;

import com.ian.dao.PerCarMapper;
import com.ian.pojo.PerCar;
import com.ian.service.PerCarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 车辆Service
 *
 * @Author IanZy
 * @Date 2020/6/18
 */
@Service
public class PerCarServiceImpl implements PerCarService {
    @Autowired
    PerCarMapper perCarMapper;


    @Override
    public List<PerCar> findCarsByUid(Integer perUserId) {
        return perCarMapper.findCarsByUid(perUserId);
    }

    @Override
    public int deleteByPrimaryKey(Integer perCarId) {
        return perCarMapper.deleteByPrimaryKey(perCarId);
    }

    @Transactional
    @Override
    public int insert(PerCar record) {
        return perCarMapper.insert(record);
    }

    @Override
    public PerCar findCarByNum(String perCarPlatenum) {
        return perCarMapper.findCarByNum(perCarPlatenum);
    }

    @Transactional
    @Override
    public int updateByPrimaryKey(PerCar record) {
        return perCarMapper.updateByPrimaryKey(record);
    }
}
